Ejemplo n.º 1
0
    public void Init(PawnStructConfig Config)
    {
        if (_moveComp)
        {
            _moveComp.Init(Config.MoveConfig);
        }

        if (_bodyComp)
        {
            _bodyComp.Init(Config.BodyConfig);
        }

        if (_shootComp)
        {
            _shootComp.Init(Config.ShootConfig);
        }
    }
Ejemplo n.º 2
0
    BodyComponent NewBodyComponent(Vector3 location, bool isCore = false)
    {
        GameObject body;

        if (isCore)
        {
            body = (GameObject)Instantiate(corePrefab);
        }
        else
        {
            body = (GameObject)Instantiate(bodyPrefab);
        }

        body.transform.parent        = this.transform;
        body.transform.localPosition = new Vector3(10000, 10000, 10000);
        BodyComponent bc = body.GetComponent <BodyComponent> ();

        bc.Init(this, location);

        bodyComponents.Add(location, bc);

        return(bc);
    }