示例#1
0
    void Start()
    {
        headGear   = GameObject.Find("HeadGear").GetComponent <HeadGear>();
        projectile = transform.FindChild("Hands").GetComponent <Projectile>();
        running    = false;

        if (spriteRend.enabled == true)
        {
            projectile.oShow(true);
        }
    }
 public void MultiPlayerFind()
 {
     hands      = GameObject.Find("Hands").GetComponent <Hands>();
     playStat   = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerStats>();
     database   = GameObject.FindGameObjectWithTag("Item Database").GetComponent <ItemDatabase>();
     vehicle    = GameObject.Find("dirtbike").GetComponent <Vehicle>();
     guns       = GameObject.FindGameObjectWithTag("Projectile").GetComponent <Projectile>();
     playEffect = GameObject.Find("PlayerEffects").GetComponent <PlayerEffects>();
     itemPick   = GameObject.FindGameObjectWithTag("Item").GetComponent <ItemPickup>();
     headGear   = GameObject.FindGameObjectWithTag("headGear").GetComponent <HeadGear>();
 }
    void Start()
    {
        showText = false;

        myPos = new Vector3(transform.position.x, transform.position.y);


        headGear   = transform.FindChild("HeadGear").GetComponent <HeadGear>();
        playStat   = GetComponent <PlayerStats>();
        projectile = transform.FindChild("Hands").GetComponent <Projectile>();
        running    = false;

        if (spriteRend.enabled == true)
        {
            projectile.oShow(true);
        }
    }
    // Use this for initialization
    void Start()
    {
        canShwInven = true;
        invencount  = 0;
        for (int i = 0; i < slotsX * slotsY; i++)
        {
            slots.Add(new Item());
            inventory.Add(new Item());
        }

        // InventoryMax();
        if (Application.loadedLevel != 2)
        {
            hands      = GameObject.Find("Hands").GetComponent <Hands>();
            playStat   = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerStats>();
            database   = GameObject.FindGameObjectWithTag("Item Database").GetComponent <ItemDatabase>();
            vehicle    = GameObject.Find("dirtbike").GetComponent <Vehicle>();
            guns       = GameObject.FindGameObjectWithTag("Projectile").GetComponent <Projectile>();
            playEffect = GameObject.Find("PlayerEffects").GetComponent <PlayerEffects>();
            itemPick   = GameObject.FindGameObjectWithTag("Item").GetComponent <ItemPickup>();
            headGear   = GameObject.FindGameObjectWithTag("headGear").GetComponent <HeadGear>();
        }
        // AddItem(22);
    }
示例#5
0
        /// <summary>
        /// Generates the head gear.
        /// </summary>
        /// <param name="headGears">The head gears.</param>
        /// <returns>random headgear</returns>
        private HeadGear GenerateHeadGear(HeadGear[] headGears)
        {
            int items = 0;
            HeadGear headGear = HeadGear.None;
            while (UnityEngine.Random.value < 0.25f && items < 3)
            {
                if (headGear == HeadGear.None)
                {
                    headGear = headGears[UnityEngine.Random.Range(1, headGears.Length - 1)];
                }
                else
                {
                    headGear |= headGears[UnityEngine.Random.Range(1, headGears.Length - 1)];
                }

                items++;
            }

            return headGear;
        }
示例#6
0
 /// <summary>
 /// Initializes the specified character profile.
 /// </summary>
 /// <param name="gender">The gender.</param>
 /// <param name="ethnicity">The ethnicity.</param>
 /// <param name="headGear">The head gear.</param>
 /// <param name="name">The name.</param>
 /// <param name="color">The color.</param>
 /// <param name="walkingSpeed">The walking speed.</param>
 public void Initialize(Gender gender, Ethnicity ethnicity, HeadGear headGear, string name, Color color, float walkingSpeed)
 {
     this.Gender = gender;
     this.Ethnicity = ethnicity;
     this.HeadGear = headGear;
     this.CharacterName = name;
     this.Color = color;
     this.WalkingSpeed = walkingSpeed;
 }