Exemplo n.º 1
0
    public override void Init()
    {
        if (gameObject.name == "LostBoi")
        {
            FollowNPC = true;
        }
        stats = new Stats(0, 0, 0, 0, 0, 0);
        InitInput();
        InitInventory();
        movement = GetComponent <IMovement>();
        movement.Init(this);
        gm = GameObject.FindWithTag("GameController").GetComponent <GameManager>();
        damageTextPrefab = Resources.Load <GameObject>("Prefabs/DamageText");

        IsAlive              = true;
        drops                = new Drops(0, 0);
        gm.WorldColorChange += OnWorldColorChange;
        var weaponSocket1 = transform.Find("Hand1");
        var weaponSocket2 = transform.Find("Hand2");

        dualWieldSockets = new Transform[] { weaponSocket1, weaponSocket2 };
        singleSocket     = new Transform[] { weaponSocket2 };

        // TEMP // Hard coded weapons atm
        // this changes when we get a save/load system
        AddColor(Colors.Red);
        SetBulletColor(Colors.Red);

        if (FollowNPC)
        {
            //pathFinderAI = GetComponent<PathFinderAI>();
            //nPCFollowMovement = GetComponent<NPCFollowMovement>();
        }

        else

        {
            SimpleNPCMovement   = GetComponent <SimpleNPCMovement>();
            simpleNPCMovementAI = GetComponent <SimpleNPCMovementAI>();
        }

        animationManager = GetComponent <AnimationManager>();

        if (animationManager != null)
        {
            animationManager.Init();
        }
    }
Exemplo n.º 2
0
 public Vector2 GetDirection()
 {
     simpleNPCMovement = GetComponent <SimpleNPCMovement>();
     Debug.Log("NPC inputmodule GetDirection Executed");
     return(simpleNPCMovement.getDirection());
 }