52 lines
1.0 KiB
C#
52 lines
1.0 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Fraction : FractionManager
|
|
{
|
|
public new int id;
|
|
[Header("是否完成")]
|
|
public bool CompletedorNot;
|
|
[Header("是否是错误项")]
|
|
public bool Erroritem;
|
|
[Header("当前项分数")]
|
|
public float scorercontinuer;
|
|
[Header("碰撞的名字")]
|
|
public string name;
|
|
[Header("名字")]
|
|
public string orderName;
|
|
bool Enable = false;
|
|
private void Start()
|
|
{
|
|
ins.fractions.Add(this);
|
|
Enable = true;
|
|
}
|
|
private void OnDisable()
|
|
{
|
|
if (Enable)
|
|
{
|
|
base.order.Add(id, orderName);
|
|
}
|
|
|
|
}
|
|
public void OnCollisionEnter(Collision collision)
|
|
{
|
|
if (Enable)
|
|
{
|
|
if (collision.collider.name.Equals(name))
|
|
{
|
|
CompletedorNot = true;
|
|
}
|
|
}
|
|
}
|
|
public void OnMouseDown()
|
|
{
|
|
if (Enable)
|
|
{
|
|
CompletedorNot = true;
|
|
}
|
|
|
|
}
|
|
//public
|
|
}
|