Пример #1
0
 private void Awake()
 {
     planetMovable = GetComponent <PlanetMovable>();
     planetMovable.init();
     planetMovable.setTurble(true);
     rigid    = GetComponent <Rigidbody>();
     animator = GetComponentInChildren <Animator>();
 }
    // Use this for initialization
    void Awake()
    {
        surfaceFollowHelper = GetComponent <SurfaceFollowHelper>();
        planetMovable       = GetComponent <PlanetMovable>();
        rigid = GetComponent <Rigidbody>();

        animator  = GetComponentInChildren <Animator>();
        onAirHash = Animator.StringToHash("Base Layer.onAir");
    }
Пример #3
0
    private void OnTriggerEnter(Collider other)
    {
        PlanetMovable pm = other.GetComponent <PlanetMovable>();

        if (pm == null)
        {
            return;
        }

        pm.resetGroundType(groundType);
    }
Пример #4
0
    public void doIt(GameObject gameObject)
    {
        Transform target = gameObject.transform;

        for (int i = 0; i < count; i++)
        {
            Vector3       newPos = transform.position - distance * (i + 1) * transform.forward;
            PlanetMovable pm     = GameObject.Instantiate <PlanetMovable>(source, newPos, transform.rotation);

            pm.gameObject.name = "movable" + i;

            FactoryPlugin fg = factoryPloginSocket as FactoryPlugin;
            if (fg != null)
            {
                fg.doIt(pm.gameObject);
            }

            FollowerController fc = pm.gameObject.GetComponent <FollowerController>();

            fc.followTarget = target;

            target = pm.transform;
        }
    }
Пример #5
0
 private void Awake()
 {
     planetMovable = GetComponent <PlanetMovable>();
     planetMovable.init();
 }
 private void Awake()
 {
     planetMovable = GetComponent <PlanetMovable>();
     previousUp    = transform.up;
 }