コード例 #1
0
ファイル: PlayerCharacter2D.cs プロジェクト: TR-UQAC/Cuboid
    private void Awake()
    {
        // Setting up references.
        m_GroundCheck  = transform.Find("GroundCheck");
        m_CeilingCheck = transform.Find("CeilingCheck");

        m_Anim        = GetComponent <Animator>();
        m_Rigidbody2D = GetComponent <Rigidbody2D>();

        activeUpgradeTable = new Dictionary <string, bool>();
        activeUpgradeTable.Clear();

        weaponList = new List <string>();
        AddWeapon("BasicBeam");

        if (GameObject.FindGameObjectWithTag("HealthUI"))
        {
            bar = GameObject.FindGameObjectWithTag("HealthUI");
        }

        GameObject.FindGameObjectWithTag("BulletUI").GetComponent <Image>().color = new Vector4(1, 1, 1, 1);

        spriteR = gameObject.GetComponent <SpriteRenderer>();

        StartCoroutine(LateStart(0.1f));

        currentWeapon = (Weapon)transform.Find("Weapon").gameObject.GetComponent(typeof(Weapon));
        grappleBeam   = gameObject.GetComponent <GrappleBeam>();

        if (m_backSphere != null)
        {
            m_backSphere.GetComponent <SpriteRenderer>().flipX = spriteR.flipX;
        }

        UpdateHealthBar();
    }
コード例 #2
0
ファイル: Ship_3D.cs プロジェクト: redahanb/Thrust
 // Use this for initialization
 void Start()
 {
     shipHull = GetComponent<Rigidbody> ();
     grapple = transform.GetChild (0).GetComponent<GrappleBeam> ();
 }