Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        m_rigidbody   = this.GetComponent <Rigidbody2D>();
        m_Animator    = this.transform.Find("Body").GetComponent <Animator>();
        m_tran        = this.transform;
        m_SpriteGroup = this.transform.Find("Body").GetComponentsInChildren <SpriteRenderer>(true);

        Instance = this;
    }
    // Use this for initialization
    void Start()
    {
        anim             = this.GetComponent <Animator>();
        playerController = GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterController_2D>();
        playerTrans      = GameObject.FindGameObjectWithTag("Player").transform;

        relativePlayerTransform = new GameObject().transform;

        //left point
        leftPoint          = new GameObject().transform;
        leftPoint.position = new Vector3(this.transform.position.x - maxTravelDistance, this.transform.position.y, this.transform.position.z);

        //right point
        rightPoint          = new GameObject().transform;
        rightPoint.position = new Vector3(this.transform.position.x + maxTravelDistance, this.transform.position.y, this.transform.position.z);

        currentPoint = rightPoint;
    }
Beispiel #3
0
    // Update is called once per frame
    void Update()
    {
        if (load && !loaded)
        {
            InitGrasslandChunks();

            p_Script    = player.GetComponent <CharacterController_2D>();
            playerNodes = p_Script.GetNodePos();

            s_size = AssetManager.Instance.GetSpriteSize();
        }
        if (loaded)
        {
            playerNodes = p_Script.GetNodePos();
            playerNodes.Add(player.transform.position);
            CheckForNewSeeds(playerNodes);
            CheckForOldSeeds(player.transform.position);
        }
    }
Beispiel #4
0
 void Start()
 {
     m_parent = this.transform.root.transform.GetComponent <CharacterController_2D>();
 }
 // Use this for initialization
 void Start()
 {
     playerController = FindObjectOfType <CharacterController_2D>();
     playerTrans      = GameObject.FindGameObjectWithTag("Player").transform;
 }