First project upload

This commit is contained in:
Rohan
2026-06-26 22:41:39 +05:30
parent 7f6e734b16
commit 604c0c786a
4637 changed files with 4299718 additions and 489307 deletions

View File

@@ -0,0 +1,35 @@
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.InputSystem;
public class CharacterRoleSetup : MonoBehaviour
{
public void SetupAsPlayer()
{
GetComponent<PlayerControllerNewRohan>().enabled = true;
GetComponent<PlayerInput>().enabled = true;
//GetComponent<EnemyAI>().enabled = false;
var agent = GetComponent<NavMeshAgent>();
if (agent != null) agent.enabled = false;
gameObject.tag = "Player";
}
public void SetupAsEnemy(Transform target)
{
GetComponent<PlayerControllerNewRohan>().enabled = false;
//GetComponent<EnemyAI>().enabled = true;
//GetComponent<EnemyControllerNew>().target = target;
var agent = GetComponent<NavMeshAgent>();
if (agent != null) agent.enabled = true;
var input = GetComponent<PlayerInput>();
if (input != null) input.enabled = false;
gameObject.tag = "Enemy";
}
}