예제 #1
0
파일: EnemyBrain.cs 프로젝트: naaturaz/SM
    public EnemyBrain(Person person)
    {
        _person  = person;
        _storage = BuildingController.FindTheClosestOfContainTypeFullyBuilt("Storage", _person.transform.position);

        SetMyDummyToMyCurrPosAndIni();
        _fin = _storage;

        CreateRoute();
        GameController.ChangeGameModeTo(H.War);
    }
예제 #2
0
파일: UnitsManager.cs 프로젝트: Cdrix/SM
    public Transform GiveMeClosestUnit(Vector3 from)
    {
        var tMin = GetClosestEnemy(Units, from);

        if (tMin == null)
        {
            //tMin = Program.gameScene.BuildingManager.GetClosestBuild(from);
            tMin = BuildingController.FindTheClosestOfContainTypeFullyBuilt("Storage", from).transform;
        }

        return(tMin);
    }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        StartCoroutine("OneSecUpdate");

        _base  = BuildingController.FindTheClosestOfContainTypeFullyBuilt("Storage", transform.position).gameObject;
        _agent = GetComponent <NavMeshAgent>();

        base.Start();
        _marker = GetChildCalled("Marker");

        Ammo = 200;

        //Health = 6;
        StartTargetAdquired();
        LoadBulletGO();
    }
예제 #4
0
    private void CheckOnAgentAndTarget()
    {
        if (Health == 0)
        {
            return;
        }

        if (_didTargetRocket)
        {
            return;
        }

        var dist = Vector3.Distance(transform.position, _base.transform.position);

        if (dist > 40)
        {
            TargetRocket();
            return;
        }

        _targetPos = BuildingController.FindTheClosestOfContainTypeFullyBuilt("Storage", transform.position).transform.position;
    }
예제 #5
0
    /// <summary>
    /// So it gets added back to the closest Storage
    /// </summary>
    /// <param name="item"></param>
    /// <param name="amt"></param>
    /// <param name="position"></param>
    public void Add(P item, float amt, Vector3 position)
    {
        var closest = BuildingController.FindTheClosestOfContainTypeFullyBuilt("Storage", position, true);

        closest.Inventory.Add(item, amt);
    }