Ejemplo n.º 1
0
 void Start()
 {
     root = transform.parent.parent.gameObject;
     //childFrustum = GetComponentInChildren<LocalFrustum>();
     charge   = root.GetComponent <GhostCharge>();
     teleport = root.GetComponent <GhostTeleport>();
 }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        roomCollection = FindObjectOfType <RoomCollection>() as RoomCollection;
        GameManager.instance.RegisterEnemyToRadarHelper(this);
        if (!animator)
        {
            animator = GetComponentInChildren <Animator>();
        }
        currentHealth = maxHealth;
        Frustum frustum = GetComponent <Frustum>();

        //m_networkFrustum = frustum.gameObject;
        //TODO: maybe change to add isServer?
        //if (isServer) {
        //m_networkFrustum = Instantiate (frustumPrefab, transform.GetChild (0).position, transform.GetChild (0).rotation) as GameObject;

        //NetworkServer.Spawn (m_networkFrustum);
        //m_networkFrustum.transform.parent = transform.GetChild(0).transform;
        frustum.PostStart();
        //}
        damageTextPool = GetComponent <ObjectPool>();
        charge         = GetComponent <GhostCharge>();
        if (isServer)
        {
            Rpc_SetTarget(roomCollection.GetRandomPositionInRoom());
        }
    }