public void RegisterCharacter(CubePlayer player)
    {
        m_Players.AddLast(player);

        if (m_Players.Count == 1){
            GiveControlToNextPlayer();
        }
    }
 public void initialize(GameObject Owner, Transform LaunchPoint, float Damage, float initalVelocity, float angle, projectileType type, Allegiance allegiance, ProjectileName name, float DropRate)
 {
     this.gameObject.SetActive(true);
     this.Owner = Owner.GetComponent <CubePlayer>();
     this.transform.position = LaunchPoint.position;
     this.transform.rotation = LaunchPoint.rotation;
     this.forward            = LaunchPoint.forward;
     forward.y           = 0;
     this.initalVelocity = initalVelocity;
     this.angle          = angle;
     this.type           = type;
     this.allegiance     = allegiance;
     this.pName          = name;
     this.dropRate       = DropRate;
     Child = transform.GetChild(0).gameObject;
 }
 public void Reset()
 {
     this.Owner              = null;
     this.initalVelocity     = 0;
     this.angle              = 0;
     this.allegiance         = Allegiance.Neutral;
     this.damage             = 0;
     this.transform.position = Vector3.zero;
     this.transform.parent   = null;
     this.lanched            = false;
     this.newPosition        = Vector3.zero;
     this.newDirection       = Vector3.zero;
     this.lifeTime           = 0;
     this.height             = 0;
     this.distanceTraveled   = 0;
     this.forward            = Vector3.zero;
     this.spin = 0;
     this.gameObject.SetActive(false);
 }
Esempio n. 4
0
 public MenuControl(GameObject DisplayMesh, CubePlayer owner)
 {
     Owner  = owner;
     Atlas  = Resources.Load <Texture2D>("IconAtlas");
     UIData = new UITileMap[3, 3];
     for (int i = 0; i < 3; i++)
     {
         UIData[i, 0] = new UITileMap(TileUVIndex.Trans);
         UIData[i, 1] = new UITileMap(TileUVIndex.Trans);
         UIData[i, 2] = new UITileMap(TileUVIndex.Trans);
     }
     UI      = new UIMeshScript();
     MeshObj = DisplayMesh;
     UI.init(15, 15, MeshObj);
     UI.BuildUVMap(Atlas, UIData);
     UI.SetTexture(Atlas);
     ChangeDisplay();
     UI.Show(isDisplaying);
 }
    // Start is called before the first frame update
    void Start()
    {
        //Initialize components
        rigid  = transform.GetComponent <Rigidbody>();
        agent  = transform.GetComponent <NavMeshAgent>();
        player = GameObject.FindWithTag("Player").GetComponent <CubePlayer>();

        //Find the connection indicator object and deactivate it
        connectionIndicator = transform.FindDeepChild("Connection Indicator").gameObject;
        indicatorRenderer   = connectionIndicator.GetComponent <Renderer>();
        connectionIndicator.SetActive(false);

        //Indicate this Follower object is not following another object
        isFollowing = false;

        //Initialize a value for index
        index = 0;

        inList = false;

        isDead = false;
    }