Esempio n. 1
0
    void Start()
    {
        //把線條記錄到hero的 vLine
        //地板的線條
        GameObject goHero = GameObject.Find("hero");

        PhysicUnit hero = goHero.GetComponent <PhysicUnit>();

        BoxCollider2D b2d        = gameObject.GetComponent <BoxCollider2D>();
        Vector2       leftPoint  = new Vector2(b2d.bounds.min.x, b2d.bounds.max.y);
        Vector2       rightPoint = new Vector2(b2d.bounds.max.x, b2d.bounds.max.y);

        //bounds的資訊https://imgur.com/HEPPFdZ
        PhysicUnit.vLine.Add(new Line(leftPoint, rightPoint));
    }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        physicUnit = gameObject.GetComponent <PhysicUnit>();

        GameObject.DontDestroyOnLoad(gameObject);
    }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     physicUnit = gameObject.GetComponent <PhysicUnit>();
 }
Esempio n. 4
0
 public Operand(double value, PhysicUnit physicUnit)
 {
     Value      = value;
     PhysicUnit = physicUnit;
 }