-
Notifications
You must be signed in to change notification settings - Fork 5
Code Samples
NOTE: These code samples are intended to be modified. They may not work as intended until said action is done.
This is a page in which you can find examples of custom Code Samples made to recreate certain aspects or functions.
Have fun.
Note: This will not work unless you have an embedded resource of kill.png and replace the asset path with one output by the game console saying your embedded resource's path.
Explanation
[1]
[2]
CustomButton killButton = DillyzUtil.addButton(System.Reflection.Assembly.GetExecutingAssembly(), "Kill Button", "ExampleRolePackage.kill.png", -1f, true, new string[] { "Impostor", "ShapeShifter" }, new string[] { "Impostor", "ShapeShifter" }, delegate(KillButtonCustomData button, bool success) {
if (!success)
return;
DillyzUtil.RpcCommitAssassination(PlayerControl.LocalPlayer, button.killButton.currentTarget);
});
killButton.buttonText = "Kill";
killButton.textOutlineColor = new Color32(253, 25, 25, 255);
CustomRole impostorRole = DillyzUtil.createRole("Impostor", "Kill crewmates and hide in vents.", true, false, new Color32(253, 25, 25, 255), true, CustomRoleSide.Impostor, VentPrivilege.Impostor, true, true);
impostorRole.a_or_an = "an";
CustomRole crewmateRole = DillyzUtil.createRole("Crewmate", "Do tasks and vote out suspects.", false, false, new Color32(139, 253, 253, 255), false, CustomRoleSide.Crewmate, VentPrivilege.None, false, false);
crewmateRole.a_or_an = "an";
Note: This will not work unless you have an embedded resource of your png and replace the asset path with one output by the game console saying your embedded resource's path.
Explanation
[1]
[2]
[3]
[4]
GameObject customObject = new GameObject(); // [1]
customObject.name = "goober";
customObject.transform.position = PlayerControl.LocalPlayer.transform.position; // [2]
SpriteRenderer sprrend = customObject.AddComponent<SpriteRenderer>(); // [3]
sprrend.sprite = DillyzUtil.getSprite(System.Reflection.Assembly.GetExecutingAssembly(), "ExampleRolePack.goober.png"); // [4]
For extra support regarding the DillyzRoleApi, come talk in my Discord Server or submit an issue.
This mod is not affiliated with Among Us or Innersloth LLC, and the content contained therein is not endorsed or otherwise sponsored by Innersloth LLC.
Portions of the materials contained herein are property of Innersloth LLC. © Innersloth LLC.
To make usage of this API, you must agree to and follow the Innersloth mod policy.
I am not reponsible for any damage, harm, etc caused by using this API in any form.