コード例 #1
0
    public virtual void setLadderData(LadderInfo ladderInfo)
    {
        // rotate by init angle
        initAngle = ladderInfo.initAngle;
        transform.Rotate(0, 0, -initAngle);
        initPosition = ladderInfo.initPosition.GetV3();
        type         = ladderInfo.type;
        timeout      = ladderInfo.timeout;

        if (ladderInfo.movement == null || ladderInfo.movement.speed <= 0)
        {
            GetComponent <LadderMovement>().enabled = false;
        }
        else
        {
            GetComponent <LadderMovement>().enabled = true;
            GetComponent <LadderMovement>().SetMovementData(ladderInfo.movement);
        }

        if (ladderInfo.rotate == null || ladderInfo.rotate.speed <= 0)
        {
            GetComponent <LadderRotate>().enabled = false;
        }
        else
        {
            GetComponent <LadderRotate>().enabled = true;
            GetComponent <LadderRotate>().SetRotateData(ladderInfo.rotate);
        }
    }
コード例 #2
0
    public LadderInfo(Constants.LadderType type, MyVector3 initPosition, float initAngle, float timeout, LadderMovementData movement, LadderRotateData rotate)
    {
        this.type         = type;
        this.initPosition = initPosition;
        this.initAngle    = initAngle;
        this.timeout      = timeout;

        this.movement = movement;
        this.rotate   = rotate;
    }
コード例 #3
0
    public LadderInfo(LadderInfo other)
    {
        this.type         = other.type;
        this.initPosition = other.initPosition;
        this.initAngle    = other.initAngle;
        this.timeout      = other.timeout;

        this.movement = other.movement;
        this.rotate   = other.rotate;
    }
コード例 #4
0
ファイル: Ladder.cs プロジェクト: Raunio/Bearventure
        public Ladder(ContentManager content, Constants.LadderType type, Vector2 position)
        {
            this.type = type;
            this.position = position;

            TAG = "Ladder";
            IsActive = true;
            this.BoundingBoxOffset = 10;

            Initialize(content);
        }