コード例 #1
0
 void Awake()
 {
     instance   = this;
     inputs     = GetComponent <PlayerInputs>();
     moviments  = GetComponent <PlayerMoviments>();
     animations = GetComponent <PlayerAnimations>();
     data       = GetComponent <PlayerData>();
     rgdb       = GetComponent <Rigidbody2D>();
 }
コード例 #2
0
ファイル: ControllerPlayer.cs プロジェクト: amarotxt/Risco2
 // Use this for initialization
 void Start()
 {
     playerMoviments     = GameObject.Find("PlayerMoviments");
     savePositions       = playerMoviments.GetComponent <PlayerMoviments>();
     player              = new Player();
     player.direction    = new Vector2(1, 0);
     player.inLine       = true;
     player.acceleration = 2;
     player.points       = 0;
     player.bonus        = 0;
 }
コード例 #3
0
ファイル: MovePlayer.cs プロジェクト: amarotxt/Risco2
    void Start()
    {
        notHaveMovments      = true;
        positionPlayerModify = new List <Vector3> ();
        i     = 0;
        speed = 10;

        playerMoviments = GameObject.Find("PlayerMoviments");
        if (playerMoviments != null)
        {
            savePositions   = playerMoviments.GetComponent <PlayerMoviments>();
            notHaveMovments = false;
        }
        positionPlayerModify.Clear();
        if (!notHaveMovments)
        {
            positionsPlayer = savePositions.PositionsMoviments;
            foreach (Vector3 a in positionsPlayer)
            {
                positionPlayerModify.Add(new Vector3(a.x * 0.2f, a.y * 0.2f));
            }
        }
    }