Exemplo n.º 1
0
    /// <summary>
    /// 跟随母体
    /// </summary>
    void FollowMother()
    {
        m_Owner.m_Skin.SetVisable(true);
        if (m_petFollow == null)
        {
            m_petFollow = m_Owner.m_Skin.tRoot.gameObject.AddComponent <PetFollow>();
        }
        m_petFollow.m_IsFollow = true;
        GameObject posgo = m_Owner.m_Parent.GetSkin().ProPerty.HelpPoint.GetVauleByKey(HelpPointName.petFollowPos);

        m_petFollow.SetFollowTarget(posgo.transform);
        AnimatorState state = AnimatorState.Walk;

        m_Owner.m_Skin.Move(state, Vector3.zero, ActionMode.Delta);
        if (m_Owner.m_Parent is Role)
        {
            RoleGridRun run = (m_Owner.m_Parent as Role).run;
            Int2        Pos = m_Owner.m_Parent.GetMapPos();
            if (run != null)
            {
                int flag = (run.WalkDIR == WalkDir.WALKLEFT)? -1 : 1;
                Pos.Unit += flag;
            }
            m_Owner.MapPos = Pos;
        }
    }
Exemplo n.º 2
0
	// Use this for initialization
	void Start () {
		curVelocity = Vector2.zero;
		petBody = GetComponent<Rigidbody2D> ();
		coins = new HashSet<GameObject> ();
		followScript = GetComponent<PetFollow> ();

//
//		StartCoroutine (SeekInFifteen());
	}
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        curVelocity  = Vector2.zero;
        petBody      = GetComponent <Rigidbody2D> ();
        coins        = new HashSet <GameObject> ();
        followScript = GetComponent <PetFollow> ();

//
//		StartCoroutine (SeekInFifteen());
    }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     follow             = GetComponent <PetFollow> ();
     originalFollowDist = follow.followDistance;
     originalMaxDist    = follow.maxDistance;
 }
Exemplo n.º 5
0
	// Use this for initialization
	void Start () {
		follow = GetComponent<PetFollow> ();
		originalFollowDist = follow.followDistance;
		originalMaxDist = follow.maxDistance;
	}