示例#1
0
    // Use this for initialization
    void Start()
    {
        playerDetector = GetComponent<CapsuleCollider>();
        player = GameObject.FindGameObjectWithTag("Player").GetComponent<Player>();
        playerControls = player.GetComponent<TwinStickController>();

        curChargeUp = chargeUpTime;
        curLaserTime = laserTime;

        laserParticlesInScene = new GameObject[towers.Length];
    }
示例#2
0
文件: Player.cs 项目: SeiZon/Fade
 //
 // Use this for initialization
 void Start()
 {
     currentHp = INITIALHP;
     if (isTutorialLevel) {
         currentHp = 1;
     }
     team = GameData.Team.Player;
     controller = GetComponent<TwinStickController>();
     gameController = Camera.main.GetComponent<GameController>();
     affectHealthIndicator();
     //
 }
示例#3
0
文件: Trigger.cs 项目: SeiZon/Fade
 // Use this for initialization
 void Start()
 {
     if (GetComponent<MeshRenderer>() != null)
     {
         GetComponent<MeshRenderer>().enabled = false;
     }
     player = GameObject.FindGameObjectWithTag("Player").GetComponent<Player>();
     playerControl = GameObject.FindGameObjectWithTag("Player").GetComponent<TwinStickController>();
 }
示例#4
0
    // Use this for initialization
    void Start()
    {
        foreach (GameObject go in  UnityEngine.Object.FindObjectsOfType<GameObject>()) {
            if ((go.layer == LayerMask.NameToLayer("Hidden KeyObjects") || go.layer == LayerMask.NameToLayer("Hidden Geometry"))) {
                MeshRenderer meshrenderer = go.GetComponent<MeshRenderer>();
                if (meshrenderer != null) meshrenderer.enabled = false;
            }

            foreach (Transform t in go.transform) {
                if ((t.gameObject.layer != LayerMask.NameToLayer("Hidden KeyObjects") && t.gameObject.layer != LayerMask.NameToLayer("Hidden Geometry"))) continue;
                List<MeshRenderer> renderers = new List<MeshRenderer>();
                renderers.AddRange(t.GetComponentsInChildren<MeshRenderer>());
                foreach (MeshRenderer m in renderers) {
                    m.enabled = false;
                }
            }
        }
        vignet = GetComponent<VignetteAndChromaticAberration>();
        grayscale = GetComponent<Grayscale>();

        playerController = GameObject.FindWithTag("Player").GetComponent<TwinStickController>();
        if (!Application.isEditor) {
            Cursor.lockState = CursorLockMode.Confined;
            Cursor.visible = false;
        }
    }
示例#5
0
文件: Painting.cs 项目: SeiZon/Fade
 // Use this for initialization
 void Start()
 {
     desiredScale = new Vector3(desiredSize, transform.localScale.y, desiredSize);
     sphereCollider = GetComponent<SphereCollider>();
     player = GameObject.FindGameObjectWithTag("Player").GetComponent<Player>();
     playercontroller = player.GetComponent<TwinStickController>();
     revealedGeometry = new List<Transform>();
     revealedKeyObjects = new List<Transform>();
     lastScale = transform.lossyScale.x;
 }
示例#6
0
文件: Boss.cs 项目: SeiZon/Fade
    // Use this for initialization
    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player").GetComponent<Player>();
        playerControl = GameObject.FindGameObjectWithTag("Player").GetComponent<TwinStickController>();

        outerRing = transform.FindChild("outer_ring");
        innerRing = transform.FindChild("inner_ring");
        particleArmor = transform.FindChild("particleArmor");

        curSpawnCooldown = enemySpawnCooldowns[0];
        curStunCooldown = stunCooldown;

        transform.position = translatePos(levelPositions[0]);

        enemiesInScene = new List<GameObject>();

        particleSystemSonar = transform.FindChild("sonar").GetComponent<ParticleSystem>();
        particleSystemDying = transform.FindChild("dying").GetComponent<ParticleSystem>();

        myMaterial = GetComponent<MeshRenderer>().material;
        audio_sonar = GetComponents<AudioSource>()[0];
        audio_beam = GetComponents<AudioSource>()[1];
        audio_misc = GetComponents<AudioSource>()[2];

        RaycastHit hit;
        Ray downRay = new Ray(transform.position, -Vector3.up);
        if (Physics.Raycast(downRay, out hit))
        {
            floor = hit.point.y;
        }
        else
        {
            floor = 0;
        }

        curOutHP = outerRingHealth;
        curInHP = innerRingHealth;

        barrelSwing = transform.FindChild("barrelSwing"); barrelSwing.rotation = swingStart;
        barrelEnd = barrelSwing.FindChild("barrelEnd");

        curSwingCooldown = firstSwingCooldown;
        curShtCooldown = shotCooldown;
        curDrainiSpawnCooldown = drainiSpawnCooldown;
        curBeamCooldown = beamCooldown;

        beamFacing = transform.FindChild("beamFacing");
        beamEnd = beamFacing.FindChild("boss_beam_end").GetComponent<ParticleSystem>();
        beam = transform.FindChild("beam").GetComponent<LineRenderer>();
        beam.SetPosition(0, transform.position);
        beam.SetPosition(1, transform.position);
        beamCharge = transform.FindChild("beamCharge").GetComponent<ParticleSystem>();
    }
示例#7
0
 void OnEnable()
 {
     twinStickController = GetComponentInParent <TwinStickController>();
 }