private void Awake()
 {
     warriorRigid             = GetComponent <Rigidbody>();                                                   // Get appropriate component
     gravityCollectorPlanet   = GameObject.FindGameObjectWithTag("Planet").GetComponent <GravityGenerator>(); // Find the tag "Planet" and get its component
     warriorRigid.useGravity  = false;
     warriorRigid.constraints = RigidbodyConstraints.FreezeRotation;                                          // Constrain the rotation.
 }
Esempio n. 2
0
    public void Init()
    {
        trans  = transform;
        body   = GetComponent <Rigidbody>();
        origin = trans.position;

        if (gravity == null)
        {
            gravity = GetComponentInParent <GravityGenerator>();
        }
    }
Esempio n. 3
0
    void Start()
    {
        // Initialize components
        gravityGenerator   = gameObject.AddComponent <GravityGenerator>();
        oxygenGenerator    = gameObject.AddComponent <OxygenGenerator>();
        warrantScanner     = gameObject.AddComponent <WarrantScanner>();
        integrityScanner   = gameObject.AddComponent <IntegrityScanner>();
        diagnosticsScanner = gameObject.AddComponent <DiagnosticsScanner>();

        tractorBeam = gameObject.AddComponent <TractorBeam>();
    }
Esempio n. 4
0
 public static void AddGenerator(GravityGenerator generator)
 {
     generators.Push(generator);
 }