Gravity modifier that repulses Objects affected by gravity that enter it's radius
Inheritance: Attractor
示例#1
0
    // Use this for initialization
    void Start()
    {
        mainCamera   = Camera.main.transform;
        inputManager = FindObjectOfType <InputManager>();
        //cameraControl = mainCamera.GetComponent<SpringCamera>();
        cameraControl = FindObjectOfType <SpringCamera>();
        rb            = GetComponent <Rigidbody>();
        repulsor      = GetComponent <Repulsor>();
        gameManager   = FindObjectOfType <GameManager>();
        audioSource   = GetComponent <AudioSource>();
        //impactInfoManager = FindObjectOfType<ImpactInfoManager>();
        bulletPool = FindObjectOfType <BulletPool>();

        // TODO: No hacerlo tan hardcodeado
        bulletPool.RegisterBullets(elipticProyectilePrefab, 30, 10);

        //
        PlayerReference.Initiate(gameObject);

        //
        lastAxisXZ = Vector3.forward;

        //
        proyectileToUse = elipticProyectilePrefab;
        proyectileRb    = proyectileToUse.GetComponent <Rigidbody>();
        PlayerReference.currentProyectileRB = proyectileRb;

        // Recordar que la masa va en gramos (de momento)
        currentMuzzleSpeed = gameManager.playerAttributes.forcePerSecond.CurrentValue / (gameManager.playerAttributes.massPerSecond / 1000);
        // Debug.Log("Muzzle speed :" + currentMuzzleSpeed);
    }
示例#2
0
 // Use this for initialization
 void Start()
 {
     rep = transform.parent.gameObject.GetComponent<Repulsor>();
     if(rep.isGravityPlane){
         //transform.localScale = transform.parent.localScale/10f;
         transform.localScale = new Vector3(1,1,1);
         particleSystem.emissionRate = transform.parent.localScale.x * transform.parent.localScale.y * transform.parent.localScale.z * 10;
     }
 }
示例#3
0
 void Awake()
 {
     //player = GameObject.Find("Monster Token");
     player      = FindObjectOfType <PlayerController>().GetComponent <CharMotor>();
     audio       = FindObjectOfType <stealthSounds>().GetComponent <stealthSounds>();
     Mtr         = GetComponent <CharMotor>();
     Anim        = GetComponentInChildren <Animation>();
     Vis         = GetComponentInChildren <Vision>();
     Rep         = GetComponent <Repulsor>();
     LnRndr      = GetComponentInChildren <LineRenderer>();
     Vis.Recv    = this;
     MaxVisRange = Mathf.Max(MaxVisRange, Vis.Radius);
 }
示例#4
0
    protected void Start()
    {
        if(WavMn == null) WavMn = FindObjectOfType<WaveMan>();
        WavMn.enemySpawned();
        Speed = SpeedWander;
        base.Start();
        //Target = FindObjectOfType<PlayerController>().Motor;

        Rep = GetComponent<Repulsor>();
        Vis = GetComponentInChildren<Vision>();

        Vis.Recv = this;

        targetWP();
    }
示例#5
0
    protected void Start()
    {
        if (WavMn == null)
        {
            WavMn = FindObjectOfType <WaveMan>();
        }
        WavMn.enemySpawned();
        Speed = SpeedWander;
        base.Start();
        //Target = FindObjectOfType<PlayerController>().Motor;

        Rep = GetComponent <Repulsor>();
        Vis = GetComponentInChildren <Vision>();

        Vis.Recv = this;

        targetWP();
    }
示例#6
0
    //Attributes


    //Methods

    public override void Initialize(StateMachine owner)
    {
        this.owner = (Repulsor)owner;
    }