예제 #1
0
    void FixedUpdate()
    {
        if(resourceScript == null) {
            resourceScript = Camera.main.gameObject.GetComponent<ResourcesControl>();
        }

        progressRate = tier;

        if(progress < 50) {
            progress += progressRate;
        } else if (progress >= 50) {
            resourceScript.gold++;
            progress = 0;
        }
    }
예제 #2
0
        public ResxPackageWindow(ResourcesControl control)
        {
            _control    = control;
            this.Width  = 800;
            this.Height = 600;

            this.MinWidth  = 500;
            this.MinHeight = 350;

            this.Content = control;

            this.UpdateDefaultStyle();

            this.Icon  = PackageRes.ResxGenIcon.GetImageSource();
            this.Title = PackageRes.Title;
        }
예제 #3
0
    void Start()
    {
        constitution = level;
        agility = level;
        strength = level;

        for(int i = 0; i < level - 1; i++) {
            int skill = UnityEngine.Random.Range (1, 5);

            switch(skill) {
            case 1:
                constitution ++;
                break;
            case 2:
                agility ++;
                break;
            case 3:
                strength ++;
                break;
            }
        }

        health = 50.0f + constitution * 10;
        speed = 1.0f + agility * 0.33f;
        hitDamage = 4.0f + strength;

        pathfind = GetComponent<AStar2D>();
        if(pathfind == null) {
            Debug.Log ("Pathfind not found!");
        }

        grid = spawnpoint.GetComponent<HumanSpawnPoint>().grid;
        map = spawnpoint.GetComponent<HumanSpawnPoint>().map;
        resourcesScript = Camera.main.gameObject.GetComponent<ResourcesControl>();
        armyScript = spawnpoint.GetComponent<HumanSpawnPoint>().monsterCore.GetComponent<MonsterCore>().armyScript;
        pathfind.speed = speed;
        pathfind.seeker.StartPath(transform.position, spawnpoint.GetComponent<HumanSpawnPoint>().monsterCore.transform.position, pathfind.OnPathComplete);
    }
예제 #4
0
    void Start()
    {
        pathfind = GetComponent<AStar2D>();
        if(pathfind == null) {
            Debug.Log ("Pathfind not found!");
        }

        grid = spawnpoint.GetComponent<HumanSpawnPoint>().grid;
        map = spawnpoint.GetComponent<HumanSpawnPoint>().map;
        resourcesScript = Camera.main.gameObject.GetComponent<ResourcesControl>();
        pathfind.speed = 1.5f;
        pathfind.seeker.StartPath(transform.position, spawnpoint.GetComponent<HumanSpawnPoint>().monsterCore.transform.position, pathfind.OnPathComplete);
    }
예제 #5
0
 void Start()
 {
     resourceScript = Camera.main.gameObject.GetComponent<ResourcesControl>();
 }
예제 #6
0
    void Start()
    {
        UICanvas.SetActive (true);

        resourceScript = gameObject.GetComponent<ResourcesControl> ();
    }