コード例 #1
0
    private void UpdateHole(StageObject obj)
    {
        UpdateStageObject(obj);
        bool touch    = obj.Direction == 1 ? obj.rightEdge >= rightSide.position.x : obj.leftEdge <= leftSide.position.x;
        bool outFrame = obj.Direction == 1 ? obj.leftEdge >= rightSide.position.x : obj.rightEdge <= leftSide.position.x;

        if (!obj.PartiallyOut && touch)
        {
            obj.PartiallyOut = true;
            int nextLane = obj.LaneIndex + (obj.Direction == 1 ? -1 : 1);
            nextLane = nextLane >= 0 ? (nextLane % lanes.Length) : (lanes.Length - 1);
            float     offset = (obj.Direction == 1 ? obj.leftEdge - obj.centerX : obj.rightEdge - obj.centerX);
            Transform side   = (obj.Direction == 1 ? leftSide : rightSide);
            SpawnMirrorHole(nextLane, offset, obj.Direction, side);
        }
        else if (obj.PartiallyOut && outFrame)
        {
            obj.MarkedForRemoval = true;
            curHoleNumber--;
            obj.GetComponent <PoolObject>().Deactivate();
        }
    }
コード例 #2
0
ファイル: Switch.cs プロジェクト: ZimingYuan/Electrified
 void Start()
 {
     iDoor = gameManagee.GetComponent <StageObject>().GetDoorByColor(color).GetComponent <Door>();
     cnt   = 0;
 }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     Touch = IsOpen = false;
     door  = gameManagee.GetComponent <StageObject>().GetDoorByColor(color).GetComponent <Door>();
 }